package com.spsoft.vatoutinv.service.vmsfulloutinvoice.impl;

import cn.hutool.db.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.spsoft.vatoutinv.entity.vmsfulloutinvoice.VmsFullOutInvoiceDetails;
import com.spsoft.vatoutinv.mapper.VmsFullOutInvoiceDetailsTestMapper;
import com.spsoft.vatoutinv.model.dto.statistics.invoiceInfoTestDto;
import com.spsoft.vatoutinv.model.vo.statistics.InvoiceInfoTestVo;
import com.spsoft.vatoutinv.model.vo.statistics.InvoiceInfoVo;
import com.spsoft.vatoutinv.service.vmsfulloutinvoice.VmsFullOutInvoiceDetailsTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service // 这里需要协商service,注解. 告诉ioc容器
 // 第一次的时候, 实现了 Service层, 但是一直报错 . 看代码是改成了单纯继承ServiceImpl ,传入mapper和实体类(数据库类)

public class VmsFullOutInvoiceDetailsTestServiceImpl  extends ServiceImpl<VmsFullOutInvoiceDetailsTestMapper, VmsFullOutInvoiceDetails> implements VmsFullOutInvoiceDetailsTestService {
    @Autowired
    VmsFullOutInvoiceDetailsTestMapper  vmsFullOutInvoiceDetailsTestMapper;

    @Override
    public  IPage<InvoiceInfoTestVo> getData(invoiceInfoTestDto dto) {
        Integer pageNo = dto.getPageNo();
        Integer pageSize = dto.getPageSize();
        IPage<InvoiceInfoTestVo> page = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(pageNo, pageSize); // 这里的可以菱形处理
        String[] split = dto.getSxjg().split(",");


        IPage<InvoiceInfoTestVo> data = vmsFullOutInvoiceDetailsTestMapper.getData(page,dto,split);
        System.out.println(data);
        return data;
    }
}
